﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Negocio.catalogos;

namespace Presentacion.controlasistencia
{
    public partial class carreras : System.Web.UI.Page
    {
       
		 
	
        catalogoCarrera _objCatalogoCarrera = new catalogoCarrera();
        string cadenaMenu = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["idDocente"] != null )
            {
                int indexColor = 0;
                var color = new List<string> { "dark-blue", "green", "blue", "orange", "red", "purple", "dark-gray", "gray", "light-gray", "yellow" };

                foreach (var item in _objCatalogoCarrera.obtenerCarrera(int.Parse(Session["idDocente"].ToString())))
                {

                    var codigoCarreraEncriptado = new encriptaje().encodeControlAsistencia(item.idCarrera);
                    cadenaMenu = string.Concat(cadenaMenu,"<div class='col-lg-4 col-sm-6'>" +
                        "<div class='circle-tile'>" +
                            "<a href='Horario.aspx?ca=" + codigoCarreraEncriptado + "'>  <div class='circle-tile-heading "+color[indexColor]+"'>" +
                                    "<i class='fa fa-users fa-fw fa-3x'></i> </div> </a>" +
                            "<div class='circle-tile-content " + color[indexColor] + "'>" +
                                "<div class='circle-tile-description text-faded'> " + item.carrera + " </div>" +
                                "<div class='circle-tile-number text-faded'> </div>" +
                            "</div> </div> </div>");
                    indexColor++;
                }

                menu.InnerHtml = cadenaMenu;

            }
            else
            {
                Server.Transfer("Default.aspx");
            }
             
        }
    }
}